
/**************************************************************************
 *         Copyright(c) 2007 by Sunplus mMedia  Technology Co., Ltd.       *
 *                                                                         *
 *  This software is copyrighted by and is the property of Sunplus mMedia  *
 *  Technology Co., Ltd. All rights are reserved by Sunplus mMedia Techno- *
 *  logy Co., Ltd. This software may only be used in accordance with the   *
 *  corresponding license agreement. Any unauthorized use, duplication,    *
 *  distribution, or disclosure of this software is expressly forbidden.   *
 *                                                                         *
 *  This Copyright notice "M U S T" not be removed or modified without     *
 *  prior written consent of Sunplus mMedia Technology  Co., Ltd.          *
 *                                                                         *
 *  Sunplus mMedia Technology Co., Ltd. reserves the right to modify this  *
 *  software without notice.                                               *
 *                                                                         *
 *  Sunplus mMedia Technology Co., Ltd.                                    *
 *  19-1, Innovation First Road, Science-Based Industrial Park,            *
 *  Hsin-Chu, Taiwan, R.O.C.                                               *
 *                                                                         *
 **************************************************************************/
#ifndef __PIMADATA_H__
#define __PIMADATA_H__
//------------------------------------------------------------------------------
//Constant and Type
//------------------------------------------------------------------------------
//Field existence
#define PIMA_OPERATIONS                         1
#define PIMA_EVENTS                             1
#define PIMA_DEVICE_PROPERTIES                  0
#define PIMA_CAPTURE_FORMATS                    0
#define PIMA_IMAGE_FORMATS                      1

//Field definition
#define K_PIMADATA_StandardVersion              0x6400          //1.00
#define K_PIMADATA_VendorExtensionID            0x00000000      //no extesnions
#define K_PIMADATA_VendorExtensionVersion       0x6400          //1.00
#define K_PIMADATA_FunctionalMode               0x0000          //standard mode

#if (PIMA_OPERATIONS)
#define K_PIMADATA_OperationsSupportedSize      0x0000000d      //size of operation supported
code    UINT16  K_PIMADATA_OperationsSupported[K_PIMADATA_OperationsSupportedSize] =
{
        K_PIMAOPE_GetDeviceInfo,                //0x0110
        K_PIMAOPE_OpenSession,                  //0x0210
        K_PIMAOPE_CloseSession,                 //0x0310
        K_PIMAOPE_GetStorageIDs,                //0x0410
        K_PIMAOPE_GetStorageInfo,               //0x0510
        K_PIMAOPE_GetNumObjects,                //0x0610
        K_PIMAOPE_GetObjectHandles,             //0x0710
        K_PIMAOPE_GetObjectInfo,                //0x0810
        K_PIMAOPE_GetObject,                    //0x0910
        K_PIMAOPE_GetThumb,                     //0x0a10 
        
        //K_PIMAOPE_DeleteObject,                 //0x0b10
 	 K_PIMAOPE_SendObjectInfo,		//0x0c10
        K_PIMAOPE_SendObject,			//0x0d10
        
        //K_PIMAOPE_GetDevicePropDesc,            //0x1410
        //K_PIMAOPE_GetDevicePropValue,           //0x1510
        //K_PIMAOPE_SetDevicePropValue,           //0x1610
        //K_PIMAOPE_ResetDevicePropValue,         //0x1710
        K_PIMAOPE_GetPartialObject,             //0x1b10
};
#else
#define K_PIMADATA_OperationSupportedSize       0x00000000      //size of operation supported
#endif

#if (PIMA_EVENTS)
#define K_PIMADATA_EventsSupportedSize          0x00000003      //size of events supported
code    UINT16  K_PIMADATA_EventsSupported[K_PIMADATA_EventsSupportedSize] =
{
       // K_PIMAEVE_CancelTransaction,            //0x0140
       K_PIMAEVE_ObjectAdded                   ,//0x0240
	K_PIMAEVE_ObjectRemoved                 ,//0x0340
	//K_PIMAEVE_StoreAdded                    ,//0x0440
	//K_PIMAEVE_StoreRemoved                  ,//0x0540
	//K_PIMAEVE_DevicePropChanged             ,//0x0640
	//K_PIMAEVE_ObjectInfoChanged             ,//0x0740
        K_PIMAEVE_RequestObjectTransfer         //0x0940
};
#else
#define K_PIMADATA_EventsSupportedSize          0x00000000      //size of events supported
#endif

#if (PIMA_DEVICE_PROPERTIES)
#define K_PIMADATA_DevicePropertiesSupportedSize 0x00000003     //size of device properties supported
code    UINT16  K_PIMADATA_DevicePropertiesSupported[K_PIMADATA_DevicePropertiesSupportedSize] =
{
        K_PIMADEV_BatteryLevel,                 //0x0150
        K_PIMADEV_ImageSize,                    //0x0350
        K_PIMADEV_DateTime,                     //0x1150
};
#else
#define K_PIMADATA_DevicePropertiesSupportedSize 0x00000000     //size of device properties supported
#endif

#if (PIMA_CAPTURE_FORMATS)
#define K_PIMADATA_CaptureFormatsSupportedSize  0x00000001      //size of capture formats supported
code    UINT16  K_PIMADATA_ImageFormatsSupported[K_PIMADATA_CaptureFormatsSupportedSize] =
{
        K_PIMAOBJ_EXIF_JPEG,                    //0x0138
};
#else
						//richie@si0401
#define K_PIMADATA_CaptureFormatsSupportedSize  0x00000000      //size of capture formats supported
#endif

#if (PIMA_IMAGE_FORMATS)
#define K_PIMADATA_ImageFormatsSupportedSize    0x00000003      //size of image formats supported
code    UINT16  K_PIMADATA_ImageFormatsSupported[K_PIMADATA_ImageFormatsSupportedSize] =
{
        K_PIMAOBJ_Association,                  //0x0130
        K_PIMAOBJ_EXIF_JPEG,                    //0x0138
        K_PIMAOBJ_Script,                        //0x0230
        //K_PIMAOBJ_DPOF,                         //0x0630
        //K_PIMAOBJ_AVI,                          //0x0a30
	//K_PIMAOBJ_JFIF,                         //0x0838
        //K_PIMAOBJ_TIFF,                         //0x0d38
};
#else
#define K_PIMADATA_ImageFormatsSupportedSize    0x00000000      //size of image formats supported
#endif

#define K_PIMADATA_VendorExtensionDescSize        0x10          //size of vendor extension descriptor
xdata    UINT16  K_PIMADATA_VendorExtensionDesc[K_PIMADATA_VendorExtensionDescSize] =
{
        0x5300,                                 //'S'
        0x7500,                                 //'u'
        0x6e00,                                 //'n'
        0x7000,                                 //'p'                         
        0x6c00,                                 //'l'
        0x7500,                                 //'u'
        0x7300,                                 //'s'
				0x6d00, 																//'m'
				0x6d00, 																//'m'
        0x0000,                                 //''
};

#define K_PIMADATA_ManufacturerSize               0x10          //size of manufacturer
xdata    UINT16  K_PIMADATA_Manufacturer[K_PIMADATA_ManufacturerSize] =
{
        0x5300,                                 //'S'
        0x7500,                                 //'u'
        0x6e00,                                 //'n'
        0x7000,                                 //'p'
        0x6c00,                                 //'l'
        0x7500,                                 //'u'
        0x7300,                                 //'s'
        0x6d00,                                 //'m'
        0x6d00,	                                //'m'
        0x0000,                                 //''
};

#define K_PIMADATA_ModelSize                    0x18            //size of model
xdata    UINT16  K_PIMADATA_Model[K_PIMADATA_ModelSize] =    
{
        0x5300,                                 //'S'
        0x7500,                                 //'u'
        0x6e00,                                 //'n'
        0x7000,                                 //'p'
        0x6c00,                                 //'l'
        0x7500,                                 //'u'
        0x7300,                                 //'s'
        0x6d00,                                 //'m'
        0x6d00,	                                //'m'
        0x2000,                                 //' '
        0x5300,                                 //'S'
        0x5000,                                 //'P'
        0x4300,                                 //'C'
        0x4100,                                 //'A'
        0x3500,                                 //'5'
        0x3300,                                 //'3'
        0x3300,                                 //'3'
        0x2000,                                 //' '
        0x0000,                                 //''
};

#define K_PIMADATA_DeviceVersionSize            0x08            //size of device version
xdata    UINT16  K_PIMADATA_DeviceVersion[K_PIMADATA_DeviceVersionSize] =
{
        0x3000,                                 //'0'
        0x3100,                                 //'1'
        0x2e00,                                 //'.'
        0x3000,                                 //'0'
        0x3000,                                 //'0'
        0x2000,                                 //' '
        0x2000,                                 //' '
        0x0000,                                 //''
};

#define K_PIMADATA_SerialNumberSize             0x08            //size of serial number 
xdata    UINT16  K_PIMADATA_SerialNumber[K_PIMADATA_SerialNumberSize] =
{
        0x3000,                                 //'0'
        0x3000,                                 //'0'
        0x2000,                                 //' '
        0x2000,                                 //' '
        0x2000,                                 //' '
        0x2000,                                 //' '
        0x2000,                                 //' '
        0x0000,                                 //''
};

//Structure definition
typedef struct _PIMADATA_DEVICE_INFO
{
        UINT16  standardVersion;
        UINT32   vendorExtensionID;
        UINT16  vendorExtensionVersion;
        STR0x10 vendorExtensionDesc;
        UINT16  functionalMode;
        UINT32   operationsSupportedSize;
#if (PIMA_OPERATIONS)
        UINT16  operationsSupported[K_PIMADATA_OperationsSupportedSize];
#endif
        UINT32   eventsSupportedSize;
#if (PIMA_EVENTS)
        UINT16  eventsSupported[K_PIMADATA_EventsSupportedSize];
#endif
        UINT32   devicePropertiesSupportedSize;
#if (PIMA_DEVICE_PROPERTIES)
        UINT16  devicePropertiesSupported[K_PIMADATA_DevicePropertiesSupportedSize];
#endif
        UINT32   captureFormatsSupportedSize;
#if (PIMA_CAPTURE_FORMATS)
        UINT16  captureFormatsSupported[K_PIMADATA_CaptureFormatsSupportedSize];
#endif
        UINT32   imageFormatsSupportedSize;
#if (PIMA_IMAGE_FORMATS)
        UINT16  imageFormatsSupported[K_PIMADATA_ImageFormatsSupportedSize];
#endif
        STR0x10 manufacturer;
        STR0x18 model;
        STR0x08 deviceVersion;
        STR0x08 serialNumber;
} PIMADATA_DEVICE_INFO, *PPIMADATA_DEVICE_INFO;



//-------------------------------------
//DevicePropDesc
//-------------------------------------
//Constant Definition
#define K_PIMADATA_GET                          0x00
#define K_PIMADATA_GET_SET                      0x01

#define K_PIMADATA_FORMFLAG_NONE                0x00
#define K_PIMADATA_FORMFLAG_RANGE               0x01
#define K_PIMADATA_FORMFLAG_ENUM                0x02

//Structure Definition
//Battery Level
#define K_PIMADATA_BATTERY_LEVEL_DEFAULT        100
#define K_PIMADATA_BATTERY_LEVEL_MIN            0
#define K_PIMADATA_BATTERY_LEVEL_MAX            100
#define K_PIMADATA_BATTERY_LEVEL_STEP           10 
typedef struct _PIMADATA_BATTERY_LEVEL_DESC
{
        UINT16  devicePropertyCode;
        UINT16  dataType;
        UINT8   getSet;
        UINT8   defaultValue;
        UINT8   currentValue;
        UINT8   formFlag;
        UINT8   minValue;
        UINT8   maxValue;
        UINT8   stepSize;
} PIMADATA_BATTERY_LEVEL_DESC, *PPIMADATA_BATTERY_LEVEL_DESC;

//Image Size
#define K_PIMADATA_ImageSizeAmount      0x0001
#define K_PIMADATA_ImageSizeLength      0x0010
code    UINT16  K_PIMADATA_ImageSize[K_PIMADATA_ImageSizeAmount][K_PIMADATA_ImageSizeLength] =
{
        {
                0x3100,         //'1'
                0x3600,         //'6'
                0x3000,         //'0'
                0x3000,         //'0'
                0x7800,         //'x'
                0x3100,         //'1'
                0x3200,         //'2'
                0x3000,         //'0'
                0x3000,         //'0'
                0x2000,         //' '
                0x2000,         //' '
                0x2000,         //' '
                0x2000,         //' '
                0x2000,         //' '
                0x2000,         //' '
                0x0000,         //''
        },
};
typedef struct _PIMADATA_IMAGE_SIZE_DESC
{
        UINT16  devicePropertyCode;
        UINT16  dataType;
        UINT8   getSet;
        STR0x10 defaultValue;
        STR0x10 currentValue;
        UINT8   formFlag;
        UINT16  numberOfValues;
        STR0x10 supportedValue[K_PIMADATA_ImageSizeAmount];
} PIMADATA_IMAGE_SIZE_DESC, *PPIMADATA_IMAGE_SIZE_DESC;

//Date Time
#define K_PIMADATA_DateTimeSize         0x18
code    UINT16  K_PIMADATA_DateTime[K_PIMADATA_DateTimeSize] =
{
        0x3200,                 //'2'
        0x3000,                 //'0'
        0x3000,                 //'0'
        0x3200,                 //'2'
        0x3000,                 //'0'
        0x3100,                 //'1'
        0x3000,                 //'0'
        0x3100,                 //'1'
        0x5400,                 //'T'
        0x3000,                 //'0'
        0x3000,                 //'0'
        0x3000,                 //'0'
        0x3000,                 //'0'
        0x3000,                 //'0'
        0x3000,                 //'0'
//richie@si0401
        0x2E00,                 //'.'
        0x3000,                 //'0'
        0x2000,                 //' '
        0x2000,                 //' '
        0x2000,                 //' '
        0x2000,                 //' '
        0x2000,                 //' '
        0x2000,                 //' '
        0x0000,                 //''
};
typedef struct _PIMADATA_DATE_TIME_DESC
{
        UINT16  devicePropertyCode;
        UINT16  dataType;
        UINT8   getSet;
        STR0x18 defaultValue;
        STR0x18 currentValue;
        UINT8   formFlag;
} PIMADATA_DATE_TIME_DESC, *PPIMADATA_DATE_TIME_DESC;

#endif /*__PIMADATA_H__*/
